package pkg

import (
	"course/config"
	"fmt"
	"github.com/Baidu-AIP/golang-sdk/aip/censor"
)

type GetCensor struct {
	conclusionType uint64 `json:"conclusionType"`
}

func Censor(str string) bool {

	client := censor.NewClient(config.Conf.Censor.AccessKeyID, config.Conf.Censor.AccessKeySecret)

	res := client.TextCensor(str)

	var cen GetCensor
	if cen.conclusionType == 1 {
		return true
	}

	fmt.Println(res)

	return false
}
